﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Singleton
{
    public class TestThird
    {      
        /// <summary>
        /// 构造函数  被设置为私有 防止调用方实例化
        /// </summary>
        private TestThird()
        {

        }

        /// <summary>
        /// 利用程序运行开始就分配实例
        /// </summary>
        private static TestThird test = new TestThird();
        public static TestThird CreateInstance()
        {
            return test;
        }
    }
}
